
				<div class="box span12">
					<div class="box-header" data-original-title>
						<h2><i class="halflings-icon white edit"></i><span class="break"></span>管理员添加</h2>
						<div class="box-icon">
							<a href="#" class="btn-setting"><i class="halflings-icon white wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="halflings-icon white chevron-up"></i></a>
							<a href="#" class="btn-close"><i class="halflings-icon white remove"></i></a>
						</div>
					</div>
					<div class="box-content">
						<form class="form-horizontal" method="post" action="index.php?c=admin&a=add&admin=1">
						  <fieldset>
							<div class="control-group">
							  <label class="control-label" for="typeahead">用户名</label>
							  <div class="controls">
								<input type="text" name="username" class="span6 typeahead username" id="typeahead"  data-provide="typeahead" data-items="4">
                                <label class="username_lab reglab" type="hidden" style="color: red;">帐号不符合要求</label>
							  </div>

							</div>
                            <div class="control-group">
                              <label class="control-label" for="typeahead">密码</label>
                              <div class="controls">
                                <input type="password" name="password" class="span6 typeahead" id="typeahead"  data-provide="typeahead" data-items="4">
                              </div>
                            </div>
                            <div class="control-group">
                              <label class="control-label" for="typeahead">确认密码</label>
                              <div class="controls">
                                <input type="password" name="password1" class="span6 typeahead" id="typeahead"  data-provide="typeahead" data-items="4">
                              </div>
                            </div>
                            <div class="control-group">
                              <label class="control-label" for="typeahead">手机</label>
                              <div class="controls">
                                <input type="text" name="phone" class="span6 typeahead phone" id="typeahead"  data-provide="typeahead" data-items="4">
                                <label class="phone_lab reglab" type="hidden" style="color: red;">电话号码不符合要求</label>
                              </div>
                            </div>
                            <div class="control-group">
                              <label class="control-label" for="typeahead">邮箱</label>
                              <div class="controls">
                                <input type="text" name="email" class="span6 typeahead email" id="typeahead"  data-provide="typeahead" data-items="4">
                                <label class="email_lab reglab" type="hidden" style="color: red;">邮箱不符合要求</label>
                              </div>
                            </div>
                            <div class="control-group">
                <label for="typeahead" class="control-label">角色分类</label>
                  <div class="controls sel_list">
                      <select aria-controls="DataTables_Table_0" name="role_id" size="1" class="sel">
                          <option value="0" selected="selected">顶级分类</option>
                          <?php foreach($data as $v){?>
                          <option value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
                          <?php }?>
                      </select>
                  </div>
              </div>
							<div class="form-actions">
							  <button type="submit" class="btn btn-primary">提交</button>
							  <button type="reset" class="btn">清空</button>
							</div>
						  </fieldset>
						</form>

					</div>
				</div><!--/span-->
                <script src="resources/admin/js/jquery-1.9.1.min.js"></script>
                <script  type="text/javascript">
                $(function(){
                    $('.username').blur(function(event) {
                        /* Act on the event */
                        var str = $(this).val();
                        var reg=/^[a-zA-Z]\w{3,11}$/;
                        var result = reg.exec(str);
                        if(result==null){
                            $('.username_lab').html('帐号不符合要求');
                        }else{
                            $('.username_lab').html('');
                        }
                    });
                    $('.phone').blur(function(event) {
                        /* Act on the event */
                        var str = $(this).val();
                        var reg=/^1[3-8]\d{9}$/;
                        var result = reg.exec(str);
                        if(result==null){
                            $('.phone_lab').html('电话号码不符合要求');
                        }else{
                            $('.phone_lab').html('');
                        }
                    });
                    $('.email').blur(function(event) {
                        /* Act on the event */
                        var str = $(this).val();
                        var reg=/\w+@\w+\.(com|cn|net)$/;
                        var result = reg.exec(str);
                        if(result==null){
                            $('.email_lab').html('邮箱不符合要求');
                        }else{
                            $('.email_lab').html('');
                        }
                    });
                    $('.btn-primary').click(function(event) {
                        /* Act on the event */
                       var t= $('.reglab').text();
                        if(t!=''){
                            alert('请填写正确的信息');
                            return false;
                        }
                    });
                })
                </script>

